diff --git a/src/_pytest/junitxml.py b/src/_pytest/junitxml.py
index 15c630b1d..4456e4509 100644
--- a/src/_pytest/junitxml.py
+++ b/src/_pytest/junitxml.py
@@ -657,6 +657,10 @@ class LogXML:
         )
         logfile.write('<?xml version="1.0" encoding="utf-8"?>')
 
+        import socket
+        hostname = socket.gethostname()
+        timestamp = time.strftime('%Y-%m-%dT%H:%M:%S')
+
         suite_node = Junit.testsuite(
             self._get_global_properties_node(),
             [x.to_xml() for x in self.node_reporters_ordered],
@@ -666,6 +670,8 @@ class LogXML:
             skipped=self.stats["skipped"],
             tests=numtests,
             time="%.3f" % suite_time_delta,
+            hostname=hostname,
+            timestamp=timestamp,
         )
         logfile.write(Junit.testsuites([suite_node]).unicode(indent=0))
         logfile.close()
